package com.example.demo.service.impl.gongChang;

public class ProductFactory extends FactoryMethod {
    @Override
    protected Product crearteProduct(String activity) {
        if (EnumProductType.activityOne.getName().equals(activity)) {
            // 业务逻辑。。。
            System.out.println("我被执行了。。ProductFactory: " + EnumProductType.activityOne.getName());
            return new OnePruduct();
        }else if (EnumProductType.activityTwo.getName().equals(activity)) {
            System.out.println("我被执行了。。ProductFactory: " + EnumProductType.activityTwo.getName());
            return new TwoPruduct();
        }
        return null;
    }

    public static class OnePruduct extends Product {

    }

    public static class TwoPruduct extends Product {

    }

}
